unsigned long hypercall_create_continuation(
unsigned int op, const char *format, ...)
{
- struct mc_state *mcs = &mc_state[smp_processor_id()];
+ struct mc_state *mcs = &this_cpu(mc_state);
struct vcpu *v = current;
const char *p = format;
unsigned long arg;
unsigned long hypercall_create_continuation(
unsigned int op, const char *format, ...)
{
- struct mc_state *mcs = &mc_state[smp_processor_id()];
+ struct mc_state *mcs = &this_cpu(mc_state);
struct cpu_user_regs *regs;
const char *p = format;
unsigned long arg;
s_time_t stime_master_stamp;
struct time_scale tsc_scale;
struct timer calibration_timer;
-} __cacheline_aligned;
+};
static DEFINE_PER_CPU(struct cpu_time, cpu_time);
#include <asm/current.h>
#include <asm/hardirq.h>
-struct mc_state mc_state[NR_CPUS];
+DEFINE_PER_CPU(struct mc_state, mc_state);
long
do_multicall(
XEN_GUEST_HANDLE(multicall_entry_t) call_list, unsigned int nr_calls)
{
- struct mc_state *mcs = &mc_state[smp_processor_id()];
+ struct mc_state *mcs = &this_cpu(mc_state);
unsigned int i;
if ( unlikely(__test_and_set_bit(_MCSF_in_multicall, &mcs->flags)) )
#ifndef __XEN_MULTICALL_H__
#define __XEN_MULTICALL_H__
+#include <xen/percpu.h>
#include <asm/multicall.h>
#define _MCSF_in_multicall 0
struct mc_state {
unsigned long flags;
struct multicall_entry call;
-} __cacheline_aligned;
+};
-extern struct mc_state mc_state[NR_CPUS];
+DECLARE_PER_CPU(struct mc_state, mc_state);
#endif /* __XEN_MULTICALL_H__ */